<div>

    <ol class="breadcrumb">
        <li> <i class="fa fa-anchor"></i>
            &nbsp;异常报告
        </li>
        <li>发件箱</li>
        <li style="float:right"><a href={:U("Email/add")} class="localRgihtBt"><b> 发送新信件</b></a></li>
    </ol>
    <div class="panel ">
        <div class="panel-heading"> <i class="fa fa-list"></i>
            &nbsp;&nbsp;信件列表
        </div>
        <table  class="table table-bordered table-striped table-mcit" >
            <thead>
            <tr>
                <th >
                    <empty name="is_order_name">
                        <button class='btn btn-block btn-mcit' type='submit' name='order_name' value=''>主题</button>
                        <else/>
                        <button class='btn btn-block btn-mcit btn-mcit-active'  type='submit' name='order_name' value=''>
                            <if condition="$order_name eq 1">
                                <i class="fa fa-chevron-down"></i>
                                <else/>
                                <i class="fa fa-chevron-up"></i>
                            </if>
                            &nbsp;主题
                        </button>
                    </empty>
                </th>
                <th style="width: 15%">
                    <empty name="is_order_stu_num">
                        <button class='btn btn-block btn-mcit' type='submit' name='order_stu_num' value=>接收人</button>
                        <else/>
                        <button class='btn btn-block btn-mcit btn-mcit-active' type='submit' name='order_stu_num' value=''>
                            <if condition="$order_stu_num eq 1">
                                <i class="fa fa-chevron-down"></i>
                                <else/>
                                <i class="fa fa-chevron-up"></i>
                            </if>
                            &nbsp;接收人
                        </button>
                    </empty>
                </th>
                <th style="width: 15%">
                    <empty name="is_order_idcard">
                        <button class='btn btn-block btn-mcit' type='submit' name='order_idcard' value=>发送时间</button>
                        <else/>
                        <button class='btn btn-block btn-mcit btn-mcit-active' type='submit' name='order_idcard' value=''>
                            <if condition="$order_idcard eq 1">
                                <i class="fa fa-chevron-down"></i>
                                <else/>
                                <i class="fa fa-chevron-up"></i>
                            </if>
                            &nbsp;所在地
                        </button>
                    </empty>
                </th>
                <th style="width: 15%">
                    <empty name="is_order_edit_self">
                        <button class='btn btn-block btn-mcit' type='submit' name='order_edit_self' value=''>操作</button>
                        <else/>
                        <button class='btn btn-block btn-mcit btn-mcit-active' type='submit' name='order_edit_self' value=''>
                            <if condition="$order_edit_self eq 1">
                                <i class="fa fa-chevron-down"></i>
                                <else/>
                                <i class="fa fa-chevron-up"></i>
                            </if>
                            &nbsp;操作
                        </button>
                    </empty>
                </th>
            </tr>
            </thead>
            <tbody id="DataTableContent">
            <empty name="email">
                <td colspan="99" style="text-align:center" class="danger"> <strong><i class="fa fa-meh-o"></i>
                    &nbsp;&nbsp;当前条件下没有数据</strong>
                </td>
                <else />
                <volist name="email" id="data">
                    <tr>
                        <td>{$data.title}</td>
                        <td>{$data.mail}</td>
                        <td>{$data.send_time}</td>
                        <td>
                            <a class="btn btn-sm btn-success editSchool" href="__URL__/detail/id/{$data.id}"><i class="fa fa-eye"></i>&nbsp;查看</a>
                            <if condition="$_SESSION['role'] eq 805 || $_SESSION['role'] eq 802">
                                <a class="btn btn-sm btn-danger del_Email" data-id="{$data.id}"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
                                <else /></if>
                        </td>
                    </tr>
                </volist>
            </empty>
            <tr>
                <td colspan="99" style="text-align:center">
                    <ul class="pagination">{$pageView}</ul>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
</div>
<import type='css' file="css.jquery#autocomplete" />
<import file="js.jquery#autocomplete#min" />
<script type="text/javascript">
    $("#DataTableContent").on("click",'.del_Email',function(){
        var id = $(this).attr('data-id');
        alertify.confirm("确定要删除此邮件？", function (e) {
            if (e) {
                $.ajax({
                    type: "POST",
                    url:  '{:U("Email/delEmail")}',
                    data: {id:id},
                    dataType: "json",
                    success: function(data){
                        if(data.state==100){
                            alertify.success(data.msg);
                            location.reload(true);
                        }else{
                            alertify.error(data.msg);
                        }
                    }
                });
            } else {
                alertify.error("取消操作！");
            }
        }, "mcit_default");
    });
</script>